using UnityEngine;
using UnityEngine.UI;

public class ShowInfo : MonoBehaviour
{
    public GameObject infopanel;
    public GameObject cardpanel;

    public Button player1Button1;
    public Button player1Button2;

    public Button infoButton;

    public Button cardButton;

    public Button closeinfoButton;
    public Button closecardButton;


    void Start()
    {
        infopanel.SetActive(false);
        cardpanel.SetActive(false);

        player1Button1.onClick.AddListener(() => ShowPanel(infopanel));
        player1Button2.onClick.AddListener(() => ShowPanel(infopanel));

        infoButton.onClick.AddListener(() => ShowPanel(infopanel));
        cardButton.onClick.AddListener(() => ShowPanel(cardpanel));

        closeinfoButton.onClick.AddListener(() => infopanel.SetActive(false));
        closecardButton.onClick.AddListener(() => cardpanel.SetActive(false));
    }



    void ShowPanel(GameObject panelToShow)
    {
        infopanel.SetActive(false);
        cardpanel.SetActive(false);
        panelToShow.SetActive(true);
    }

}



